<%--
  Created by IntelliJ IDEA.
  User: Yuzhihao
  Date: 2021/10/25
  Time: 20:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑订单</title>
    <link type="text/css" rel="stylesheet" href="fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
</head>
<body>
<div class="main_box">
    <div class="cont_box">
        <!--订单号-->
        <div class="user_top">订单号：<span>${byId.o_number}</span></div>
        <!--订单商品-->
        <div class="user_top order_top">订单商品：</div>
        <table border="0" cellspacing="0" cellpadding="0" class="table">
            <thead>
            <tr>
                <th>商品名称</th>
                <th>商品价格</th>
                <th>商品实际销售价格</th>
                <th>销售人员</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${all1}" var="all">
            <tr>

                <td>${all.pname}</td>
                <td>${all.price}</td>
                <td>${all.a_price}</td>
                <td>${all.s_name}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/deleteMid?id=${all.sss_id}&qwe=${all.qwe}" class="table_btn table_del del_btn">
                        <i class="fa fa-trash-o"></i>
                        <span>删除</span>
                    </a>
                </td>
            </tr>
            </c:forEach>
            </tbody>
        </table>
        <div class="clearfix" style="margin-top:20px;">
<%--            ${pageContext.request.contextPath}/findSPXs--%>
            <a href="${pageContext.request.contextPath}/findSPLB?id=${byId.id}" class="btn line_btn ">添加商品</a>
<%--            <input type="submit" value="添加商品" class="btn line_btn ">--%>
        </div>
        <!--订单服务-->
        <div class="user_top order_top">订单服务：</div>
        <table border="0" cellspacing="0" cellpadding="0" class="table pre_table">
            <thead>
            <tr>
                <th>服务名称</th>
                <th>服务价格</th>
                <th>服务实际支付价格</th>
<%--                <th>施工人员</th>--%>
                <th>销售人员</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${all4}" var="alls3">
            <tr>
                <td>${alls3.serv}</td>
                <td>${alls3.price}</td>
                <td>${alls3.ac_price}</td>
<%--                <td>李四</td>--%>
                <td>${alls3.s_name}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/deleteSer?id=${alls3.did}&ewq=${alls3.sis}" class="table_btn table_del del_btn">
                        <i class="fa fa-trash-o"></i>
                        <span>删除</span>
                    </a>
                </td>
            </tr>
            </c:forEach>
            </tbody>
        </table>
        <div class="clearfix" style="margin-top:20px;">
            <a href="${pageContext.request.contextPath}/findAddSer?id=${byId.id}" class="btn line_btn">添加服务</a>
<%--            <input type="submit" value="添加服务" class="btn line_btn">--%>
        </div>
        <!--订单备注-->
        <div class="user_top order_top">订单备注：</div>
        <textarea class="order_note">${byId.remark}</textarea>
        <form action="/findAllOrd" method="post">
        <div class="clearfix" style="margin-top:20px;">
            <input type="submit" value="确认保存" class="btn blue_btn total_btn">
        </div>
        </form>
    </div>
</div>
<!--javascript include-->
<script src="js/jquery-2.2.1.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/jquery.form.min.js"></script>
<script src="js/other.js"></script>
<script>
    $(function(){
        tableShow();
        $(".del_btn").click(function(){
            if($(this).parents("tbody").find("tr").length<=1){
                $(this).parents(".table").prev().remove();
                $(this).parents(".table").remove();
            }else{
                $(this).parents("tr").remove();
            }
        });
    });
    function tableShow(){
        $(".table").each(function(){
            if($(this).find("tbody tr").length<=0){
                $(this).prev().remove();
                $(this).remove();
            }
        });
    }
</script>
</body>
</html>
